﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CardGamesLibrary.Cards;
using CardGamesLibrary.Cards.Decks;
using CardGamesLibrary.Tables;
using CardGamesLibrary.Cards.Piles;
//using System.Diagnostics.Contracts;

namespace CardGamesLibrary.Solitaire
{
    public class SolitaireGameTable : GameTable<FrenchDeckCard>
    {
        public SolitaireGameTable() : base(1)
        {
            StockPile = new SolitaireStockPile();
            WastePile = new SolitaireWastePile();
            Piles =     new List<SolitairePile>();
            TopPiles =  new List<SolitairePile>(4);

            for (int i = 0; i < 7; i++)
            {
                // TODO : this should be another type of pile because the behavior is different
                Piles.Add(new SolitaireTablePile());
            }
            
            var enumerable = Enum.GetValues(typeof(Suite)).OfType<Suite>();
            foreach (var suite in enumerable)
            {
                TopPiles.Add(new SolitaireTopPile());
            }
            
        }

        public SolitairePile StockPile 
        { get; set; }
        public SolitairePile WastePile
        { get; set; }

        public List<SolitairePile> Piles
        { get; set; }

        public List<SolitairePile> TopPiles
        { get; set; }

        public override TableSeat CreateNewSeat()
        {
            return new TableSeat();
        }

        public override Cards.Decks.Deck<FrenchDeckCard> CreateDeck()
        {
            return new FrenchDeck();
        }
    }
}
